package com.yuyu.music.play.instance;

import javazoom.jl.decoder.JavaLayerException;
import javazoom.jl.player.Player;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.FileInputStream;

public class PlayerInstance {

    private static final Logger log = LoggerFactory.getLogger(PlayerInstance.class);

    public static Player player;

    public static Player getPlayerInstance() {
        return player;
    }

    public static void setPlayerInstance(FileInputStream stream) {
        try {
            player = new Player(stream);
        } catch (JavaLayerException e) {
            log.error("set player instance error", e);
        }
    }
}
